package com.sg.dto.biz.framework.common;


import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

@Data
public class PowerCodeListDto extends BaseDto implements Serializable {

    /**
     * 权限编码:
     */
    @ApiModelProperty("权限编码")
    private String privacyCode;

    /**
     * 是否接口权限:
     */
    @NotNull(message = "是否接口权限不能为空")
    @ApiModelProperty("是否接口权限")
    private String isportPrivacy;

    /**
     * 权限路由:
     */
    @ApiModelProperty("权限路由")
    private String privacyRoute;

    /**
     * 是否数据权限:
     */
    @NotNull(message = "是否数据权限不能为空")
    @ApiModelProperty("是否数据权限")
    private String isDataPrivacy;

    /**
     * 数据父模型编码:
     */
    @ApiModelProperty("数据父模型编码")
    private String dataModel;

    /**
     * 权限类别:
     */
    @ApiModelProperty("权限类别")
    private String privacyCategory;

    /**
     * 权限业务用途:
     */
    @ApiModelProperty("权限业务用途")
    private String businessPurposes;
    /**
     * 权限分配ID
     */
    @ApiModelProperty("权限分配ID")
    private String privacyDistributionId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        PowerCodeListDto that = (PowerCodeListDto) o;
        return privacyCode == that.privacyCode && isportPrivacy == that.isportPrivacy && privacyRoute == that.privacyRoute && isDataPrivacy == that.isDataPrivacy && dataModel == that.dataModel && privacyCategory == that.privacyCategory && businessPurposes == that.businessPurposes && privacyDistributionId == that.privacyDistributionId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), privacyCode, isportPrivacy, privacyRoute, isDataPrivacy, dataModel, privacyCategory, businessPurposes, privacyDistributionId);
    }

}
